package com.zkr.kfsz.mapper;

import com.zkr.kfsz.model.KFSZSelectVo;
import com.zkr.kfsz.model.KFSZVo;
import com.zkr.kfsz.model.KFVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import javax.validation.constraints.NotBlank;
import java.util.List;

/**
 *Created by lenovo on 2021/01/14.
 */
@Mapper
public interface KFSZMapper {
    int queryCount(KFSZSelectVo kfszSelectVo);

    List<KFSZVo> queryPage(KFSZSelectVo kfszSelectVo);

    void updateStatus(KFSZVo kfszVo);



    @Select("select * from warehouse where wareHouseCode = #{code}")
    KFSZVo queryCode(@NotBlank(message = "库房编码不能重复!") String code);

    @Select("select * from warehouse where wareHouseName =#{name}")
    KFSZVo queryName(@NotBlank(message = "库房名称不能重复!") String name);

    @Insert("insert into warehouse(wareHouseCode,wareHouseName,wareHouseRemark,status,areaName," +
            "nationName, provinceName,cityName,countyName,detailAddress,code,createName,createTime,updateName,updateTime)" +
            "values (#{code},#{name},#{remark},#{status},#{area},#{nation},#{province},#{city},#{county},#{detailAddress},#{warehouseTagCode},#{createName},#{createTime},#{updateName},#{updateTime})")
    void insertkfsz(KFSZVo kfszVo);

    @Select("select code,remark from kufang")
    List<KFVo> querykf();

    void update(KFSZVo kfszVo);





    /*int queryCount(KuFangSelectVo kuFangSelectVo);

    List<KFSZVo> queryPage(KuFangSelectVo kuFangSelectVo);

    @Select("select * from kufang where code=#{code} ")
    KFSZVo queryCode(@NotNull(message = "库房标识编码不能为空!") String code);

    @Select("select * from kufang where name=#{code}")
    KFSZVo queryName(@NotNull(message = "库房标识名称不能为空!") String name);

    @Insert("insert into kufang(name,code,remark,status,createName,createTime,updateName,updateTime)"+
    "values(#{name},#{code},#{remark},#{status},#{createName},#{createTime},#{updateName},#{updateTime})")
    void insertkufang(KFSZVo kuFangVo);

    void updateStatus(KFSZVo kuFangVo);


    KFSZVo queryById(Integer id);

    void update(KFSZVo kuFangVo1);

    //int update(KFSZVo kuFangVo1);
*/



}
